<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 一个函数被作为参数传递给另一个函数
        function say(x){
            alert(x);
        }
        function fun(callback,val){
            callback(val);
        }
        fun(say,"你好");
    </script>
</body>
</html>